package com.atguigu.gulimall.member.service;

import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;
import com.atguigu.gulimall.member.exception.PhoneExistException;
import com.atguigu.gulimall.member.exception.UsernameExistException;
import com.atguigu.gulimall.member.vo.MemberRegisterVo;
import com.atguigu.gulimall.member.vo.MemberUserLoginVo;
import com.atguigu.gulimall.member.vo.SocialUser;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * 会员
 *
 * @author yuwenyi
 * @email 1171370471@qq.com
 * @date 2021-05-25 22:57:30
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void regist(MemberRegisterVo registerVo);

    /**
     * 判断邮箱是否重复,并且使用异常机制,因此不用boolean
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneExistException;

    /**
     * 判断用户名是否重复
     * @param userName
     * @return
     */
    void checkUserNameUnique(String userName) throws UsernameExistException;

    MemberEntity login(MemberUserLoginVo vo);

    MemberEntity login(SocialUser socialUser);

}

